package networking.messages;

import java.util.ArrayList;

import logic.common.Squad;
import logic.common.player.Player;
import logic.common.team.Fraction;

public class SquadUpdateMessage extends SimpleMessage {
	
	private Fraction fraction;
	private int squadID;
	private ArrayList<Integer> playerIDs;
	
	public SquadUpdateMessage() {
		super();
	}
	
	public SquadUpdateMessage(Squad squad) {
		this();
		this.fraction = squad.getTeam().getFraction();
		this.squadID = squad.hashCode();
		
		playerIDs = new ArrayList<Integer>();
		for(Player player : squad.getMembers()) {
			playerIDs.add(Integer.valueOf(player.getID()));
		}
	}
	
	public Fraction getFraction() { return fraction; }
	
	public int getSquadID() { return squadID; }
	
	public ArrayList<Integer> getPlayerIDs() { return playerIDs; }
}